<?php
namespace common\models;

use yii\db\ActiveRecord;
use yii\behaviors\TimestampBehavior;

/**
 * 资产数据模型
 * @author CGA
 */
class ARAssets extends ActiveRecord
{

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
        ];
    }

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%assets}}';
    }
    
    /**
     * 获取虚拟币信息
     */
    public function getCoinType()
    {
        return $this->hasOne(ARCoinType::className(), ['id' => 'coin']);
    }
}
